<?php

namespace app\model;

use think\Model;

class Admin extends Model
{
    public function profile(){
        return $this->hasOne(Role::class,'id','role_id')->bind([
            'role_name' => 'name'
        ]);
    }

    public function getLastLoginTimeAttr($value){
        return $value ? date('Y-m-d H:i:s',$value):'';
    }
}